package com.bawei.room.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update
import com.bawei.room.table.VideoDaoEntity

/**
 * Author: Jason Zhang
 * Date: 2024/8/20
 * Desc: 视频信息操作类
 */
@Dao
interface VideoInfoDao {
    @Insert
    suspend fun insert(vararg videoInfo: VideoDaoEntity)

    @Delete
    suspend fun delete(vararg videoInfo: VideoDaoEntity)

    @Update
    suspend fun update(vararg videoInfo: VideoDaoEntity)

    @Query("select * from video_table order by id")
    suspend fun queryAll(): List<VideoDaoEntity>

    @Query("select * from video_table where id = :id")
    suspend fun queryById(id: Int): List<VideoDaoEntity>

}